package com.example.controller;


import com.example.MyDataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/cxy")
public class cxy {

   @Autowired
   private Environment env;
   @Autowired
   private MyDataSource myDataSource;
    @GetMapping
    public String getById(){
        System.out.println(myDataSource.getPassword());
        System.out.println(env.getProperty("server.port"));
        System.out.println(env.getProperty("datasource.username"));
        System.out.println("1111");
        return "spring is running";
    }
}
